<template>
  <div>
    <!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
      <el-radio-button :label="false">展开</el-radio-button>
      <el-radio-button :label="true">收起</el-radio-button>
    </el-radio-group> -->

    <!-- <el-switch
      v-model="isCollapse"
      active-color="#909399"
      inactive-color="#13ce66"
      style=" margin-left: 20px;"  
    >
    </el-switch> -->
    <el-container>
      <el-main>
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          label-position="top"
        >

        <el-form-item label="所属组织" style="margin-top: -10px">
            <el-select
              v-model="form.department"
              multiple
              placeholder="请选择"
              style="width: 180px"
              filterable
            >
              <el-option
                v-for="item in selectdepartment"
                :key="item.id"
                :label="item.label"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>


          <el-form-item label="人员类型" style="margin-top: -20px">
            <el-select
              v-model="form.usertype"
              placeholder="请选择"
              @change="getselecttag"
              style="width: 180px"
            >
              <el-option
                v-for="item in selectusertype"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option> </el-select
          ></el-form-item>

          <el-form-item label="人员标签" style="margin-top: -10px">
            <el-select
              v-model="form.usertag"
              multiple
              placeholder="请选择"
              style="width: 180px"
            >
              <el-option
                v-for="item in selecttag"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>


          <el-form-item>

              <el-button type="danger" @click="usersearch" style="width: 45%"
                >搜索</el-button
              >
              <el-button @click="onclean" style="width: 45%" >清空</el-button>
   
          </el-form-item>
        </el-form>
      </el-main>
    </el-container>
  </div>
</template>

<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 200px;
  margin-top: 15px;
}
.el-menu {
  border: 0 !important;
}
</style>

<script>
export default {
  props: ["form", "selectdepartment"],
  data() {
    return {
      isCollapse: false,
      selecttag: [],
      selectusertype: [
        {
          value: "0",
          label: "离职",
        },
        {
          value: "4",
          label: "面试未通过",
        },
      ],
    };
  },
  methods: {
    getReserveUser(index) {
      this.$emit("getReserveUser", index);
    },

    async getselecttag() {
      let id = this.form.usertype;
      let tag = await this.$axios.get(`api/member/getusertag?type=` + id);
      this.selecttag = tag.data;
    },

    usersearch() {
      this.$emit("usersearch");
    },

    onclean() {
      this.$emit("onclean");
    },
  },
};
</script>